package cn.stylefeng.guns.modular.business.custom.enums;

/**
 * 提车方式 取车方式
 */
public enum PickCarTypeEnum {

    XIAO_BAN_TI_CHE(1, "小板提车"),
    REN_GONG_TI_CHE(2, "人工提车"),
    ZI_SONG_WAND_DIAN(3, "自送"),
    MIAN_FEE_TI_DUAN(4, "免费提短");

    PickCarTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int type;

    public String desc;

    public static boolean valid(Integer type) {
        if (type == null) {
            return false;
        }
        PickCarTypeEnum[] pts = PickCarTypeEnum.values();
        for (PickCarTypeEnum pt : pts) {
            if (type == pt.type) {
                return true;
            }
        }
        return false;
    }

    public static String getValue(Integer type) {
        if (type == null) {
            return "";
        }
        PickCarTypeEnum[] pts = PickCarTypeEnum.values();
        for (PickCarTypeEnum pt : pts) {
            if (type == pt.type) {
                return pt.desc;
            }
        }
        return "";
    }
}
